package com.yidu.mapper;

import com.yidu.entity.UserRole;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface UserRoleMapper {
    @Select("select * from (select rownum as rn,u.* from UserRole u ) where 1=1  and rn between #{page} and #{limit}")
    public List<UserRole> selectUserRole(Map map);
    @Insert("insert into UserRole values (#{userRoleId},#{userRoleName},#{userRoleDesc},#{userRoleFlag})")
    public void insertUserRole(UserRole userRole);
    @Update("update UserRole set userRoleName = #{userRoleName},userRoleDesc = #{userRoleDesc},userRoleFlag = #{userRoleFlag} where userRoleId = #{userRoleId}")
    public void updateUserRole(UserRole userRole);
    @Delete("delete from UserRole where userRoleId = #{userRoleId}")
    public void deleteUserRole(int userRoleId);
}
